{% extends 'base_template/adminBase.html' %}
{% load static %}
{% load mathfilters %}
{% block main_content %}
    <div class="row-cols-auto">安排课程</div>
    <div class="mb-3">
    </div>
    <form action="{% url 'adminComArrCourse' %}" method="post">
        {% csrf_token %}
        <div class="input-group mb-3">
            <label>课程 &nbsp;&nbsp;</label>
            <select class="form-control" name="course" id="course">
                {% for course in courses %}
                    <option value="{{ course.id }}">{{ course.name }}</option>
                {% endfor %}
            </select>
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>

        <div class="input-group mb-3">
            <label>班级 &nbsp;&nbsp;</label>
            <select class="form-control" name="class" id="class">
                {% for class in classes %}
                    <option value="{{ class.class_id }}">{{ class.name }}</option>
                {% endfor %}
            </select>
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>

        <div class="input-group mb-3">
            <label>教员 &nbsp;&nbsp;</label>
            <select class="form-control" name="staff" id="staff">
                {% for staff in staffs %}
                    <option value="{{ staff.id }}">{{ staff.admin.username }}</option>
                {% endfor %}
            </select>
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>

        <div class="row">
            {% if messages %}
                <div class="col-12">
                    {% for message in messages %}
                        {% if message.tags == 'error' %}
                            <div class="alert alert-danger" style="margin-top:10px">{{ message }}</div>
                        {% endif %}
                        {% if message.tags == 'success' %}
                            <div class="alert alert-success" style="margin-top:10px">{{ message }}</div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
        <div class="row">
            <!-- /.col -->
            <div class="col-12">
                <button type="submit" class="btn btn-primary btn-block">确认</button>
            </div><!-- /.col -->
        </div>

    </form>

{% endblock main_content %}